package com.beiding.my.mql;

import com.beiding.my.bemapping.BeTypeMapper;
import org.springframework.beans.factory.annotation.Autowired;

abstract class ExecutorFactory {

    @Autowired
    NativeSql nativeSql;

    MQLExecutor create(String sql, BeTypeMapper beTypeMapper) {
        MQLExecutor executor = createExecutor(sql, beTypeMapper);
        executor.nativeSql = nativeSql;
        return executor;
    }

    abstract MQLExecutor createExecutor(String sql, BeTypeMapper beTypeMapper);

    abstract String name();

}
